import time

def bub(mas):
   swapped = True
   while swapped:
       swapped = False
       for g in range(len(mas)-1):
          if int(mas[g]) > int(mas[g+1]):
              mas[g], mas[g+1] = mas[g+1], mas[g]
              swapped = True
   return mas
def timesoft(mas):
    t_start = time.time() # начальное время
    к = bub(mas)
    t_finish = time.time() # конечное время
    print('Время', round((t_finish-t_start) * 1000), 'мс')

f = open('m3_shuffle.txt')
f1 = open('m1_sorted.txt')
f2 = open('m2_reverse.txt')
array = f.readlines()
array1 = f1.readlines()
array2 = f2.readlines()

timesoft(array)
timesoft(array1)
timesoft(array2)
